home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 3
/
ct-rom iiib.zip
/
ct-rom iiib
/
WINDOWS
/
UTILITY
/
DIVERSEN
/
ETC_130S
/
NOTESTUT.ETC
< prev
next >
Wrap
Text File
|
1993-03-13
|
5KB
|
172 lines
; This program is a demo of how to create a tutorial using EtCetera.
; $P stores the path where the WAV files are
$P = ActiveDirectory & "\"
; This portion confirms that we are using VGA
#A = SCRW + SCRH
If #A = 1120 Then Goto CheckETCVer
Message "This tutorial requires a VGA display."
End
; This portion confirms that we are using EtCetera 2.00 or higher
:CheckETCVer
If ETCVer >= 200 Then Goto CheckNotepad
Message "This tutorial requires EtCetera version 2.00 or higher."
End
; Here, we change to the Windows directory and confirm that Notepad
; is in this directory...
:CheckNotepad
CD WinDirectory
Match "NOTEPAD.EXE", $A
If $A Then Goto OKToStart
Message "This tutorial requires Notepad, but Notepad is not in the Windows directory."
End
; Since we passed the three requirements...
:OKToStart
Message "Click OK to begin the Notepad Tutorial"
; This section hides all currently open windows.
TitleFill 100
For #A = 100 to LINES + 99
Hide $[#A]
Next
Goto ThisHereLoc
; This demo uses Notepad, so let's bring it up!
If IsOpen "Notepad" Then Goto AlreadyRunning
Run "NOTEPAD.EXE", MAX
:AlreadyRunning
Activate "Notepad"
; Get the mouse out of the way
Mouse MOVE 0, 0
; And create the window where we display messages to the user
CreateWindow @A, 200, 200, 240, 80
; This clears the window...
PaintWindow @A, WHITE
; The next three lines display our first message to the user
WriteText @A, "Welcome to the Notepad Tutorial.", 10, 10
WriteText @A, "We will show you how to use the", 10, 30
WriteText @A "menu with the mouse.", 40, 50
PlaySound $P & "NOTE1.WAV"
; Clear the window and display the next message.
PaintWindow @A, WHITE
WriteText @A, "Please do not move the mouse", 10, 10
WriteText @A, "or press a key during this tutorial.", 10, 30
PlaySound $P & "NOTE2.WAV"
; Next message
PaintWindow @A, WHITE
WriteText @A, "To use a menu, you can either", 10, 10
WriteText @A, "use the keyboard or the mouse.", 10, 30
PlaySound $P & "NOTE3.WAV"
WriteText @A, "To use the mouse, move it...", 10, 50
PlaySound $P & "NOTE4.WAV"
; Here, we simulate mouse movement
Mouse MOVE 300, 300
For #A = 300 to 20 Step -2
Mouse MOVE #A, #A
Next
; Display the next message
PaintWindow @A, WHITE
WriteText @A, "Then click the LEFT mouse button.", 10, 10
PlaySound $P & "NOTE5.WAV"
; Simulate a mouse click
Mouse LEFT CLICK
; Display the next message
WriteText @A, "You'll see the menu drop down", 10, 30
WriteText @A, "from the menu bar.", 10, 50
PlaySound $P & "NOTE6.WAV"
; Next message...
PaintWindow @A, WHITE
WriteText @A, "Now, we move the mouse pointer", 10, 10
WriteText @A, "to the item we want to choose.", 10, 30
WriteText @A, "We'll choose the Open command.", 10, 50
PlaySound $P & "NOTE7.WAV"
; Simulate mouse movement
Mouse MOVE 20, 20
For #A = 20 to 65 Step 1
Mouse MOVE 20, #A
Next
; Next message...
PaintWindow @A, WHITE
WriteText @A, "And, again, click the LEFT mouse", 10, 10
WriteText @A, "button.", 95, 30
PlaySound $P & "NOTE8.WAV"
; Simulate mouse click
Mouse LEFT CLICK
Wait 2 seconds
; And move the dialog box out of the way
Move 0, 0
; Get rid of the previous window
DestroyWindow @A
; And recreate it in the lower right corner of the display
CreateWindow @A, 399, 399, 240, 80
; Display the next message...
PaintWindow @A, WHITE
WriteText @A, "A dialog box appears which allows", 10, 10
WriteText @A, "us to open a file.", 60, 30
PlaySound $P & "NOTE9.WAV"
; Next message...
PaintWindow @A, WHITE
WriteText @A, "Since we do not want to open a file,", 10, 10
WriteText @A, "we will press the ESC key to close", 10, 30
WriteText @A, "the dialog box...", 50, 50
PlaySound $P & "NOTE10.WAV"
; Get rid of our window (since it receives keystrokes, since it's active)
DestroyWindow @A
; Send ESC to dialog box
SendKeys "{ESC}"
Wait 2 seconds
; Recreate centered text window and display message
CreateWindow @A, 200, 200, 240, 80
PaintWindow @A, WHITE
WriteText @A, "And that's all there is to it! Once", 10, 10
WriteText @A, "this tutorial ends, it's your turn", 10, 30
WriteText @A, "to try it!", 90, 50
PlaySound $P & "NOTE11.WAV"
; Get rid of text window
DestroyWindow @A
; Kill Notepad
Close "Notepad"
:ThisHereLoc
; Unhide all hidden windows
TitleFill 100
#L = Lines
Message $#L
For #A = 100 to LINES + 99
Message $[#A], $#A
UnHide $[#A]
Next
; And leave!
Message "This tutorial is done.", "EtCetera Demo"